include("shared.lua");

--local material = Material("effects/combineshield/comshieldwall3");
local material = Material("effects/com_shield004a");

local dual_sides = true

function ENT:Draw()	
	local pos = self.Entity:GetPos();
	
	local size = self.Entity:GetNWVector( "MaxVec" ) - self.Entity:GetNWVector( "MinVec" );
	
	render.SetMaterial( material );
	
	-- Top and bottom
	render.DrawQuadEasy( self.Entity:GetPos() + Vector(size.x * 0.5, size.y * 0.5, size.z), Vector(0, 0, 1), size.y, size.x );
	render.DrawQuadEasy( self.Entity:GetPos() + Vector(size.x * 0.5, size.y * 0.5, size.z), Vector(0, 0, -1), size.y, size.x );
	render.DrawQuadEasy( self.Entity:GetPos() + Vector(size.x * 0.5, size.y * 0.5, 0), Vector(0, 0, 1), size.y, size.x );
	render.DrawQuadEasy( self.Entity:GetPos() + Vector(size.x * 0.5, size.y * 0.5, 0), Vector(0, 0, -1), size.y, size.x );
	
	-- Sides Y axis
	render.DrawQuadEasy( self.Entity:GetPos() + Vector(size.x * 0.5, 0, size.z * 0.5), Vector(0, 1, 0), size.x, size.z );
	render.DrawQuadEasy( self.Entity:GetPos() + Vector(size.x * 0.5, 0, size.z * 0.5), Vector(0, -1, 0), size.x, size.z );
	render.DrawQuadEasy( self.Entity:GetPos() + Vector(size.x * 0.5, size.y, size.z * 0.5), Vector(0, 1, 0), size.x, size.z );
	render.DrawQuadEasy( self.Entity:GetPos() + Vector(size.x * 0.5, size.y, size.z * 0.5), Vector(0, -1, 0), size.x, size.z );
	
	-- Sides X axis
	render.DrawQuadEasy( self.Entity:GetPos() + Vector(0, size.y * 0.5, size.z * 0.5), Vector(1, 0, 0), size.y, size.z );
	render.DrawQuadEasy( self.Entity:GetPos() + Vector(0, size.y * 0.5, size.z * 0.5), Vector(-1, 0, 0), size.y, size.z );
	render.DrawQuadEasy( self.Entity:GetPos() + Vector(size.x, size.y * 0.5, size.z * 0.5), Vector(1, 0, 0), size.y, size.z );
	render.DrawQuadEasy( self.Entity:GetPos() + Vector(size.x, size.y * 0.5, size.z * 0.5), Vector(-1, 0, 0), size.y, size.z );
end


function ENT:Think()
	local size = self.Entity:GetNWVector( "MaxVec" ) - self.Entity:GetNWVector( "MinVec" );
	
	local vecmin = Vector(-size.x, -size.y, -size.z)
	local vecmax = Vector(size.x, size.y, size.z)
	
	self.Entity:SetRenderBounds(vecmin, vecmax);
end


/*---------------------------------------------------------
   Name: IsTranslucent
---------------------------------------------------------*/
function ENT:IsTranslucent()
	return true;
end

